﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;

namespace Jackie.Silverliight.SetpBySetp.BasicControl
{
    public partial class ColorPicker : Page
    {
        public ColorPicker()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void AlphaSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            if ((AlphaSlider != null) && (RedSlider != null) && (GreenSlider != null) && (BuleSlider != null))
            {
                Color color = Color.FromArgb((byte)AlphaSlider.Value, (byte)RedSlider.Value, (byte)GreenSlider.Value,
                                             (byte)BuleSlider.Value);
                previewColor.Fill = new SolidColorBrush(color);
                HexColor.Text = color.ToString();
            }
        }
    }
}
